package ATM;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ExitFrame extends JFrame {

    public ExitFrame() {

        this.setLayout(null);
        JLabel jl = new JLabel("请取回你的卡片");
        jl.setBounds(200, 100, 200, 30);
        this.add(jl);

        MyButton exitButton = new MyButton("退出", 350, 200, this);
        this.setSize(500, 300);
        this.setVisible(true);
        this.setDefaultCloseOperation(3);
        this.setLocationRelativeTo(null);
        this.setTitle("取卡");

        exitButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });
    }
}
